<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link href="/js/wangeditor/css/style.css" rel="stylesheet">
<style>

    .layui-upload-colse {
        position: relative;
    }

    .closeUpload {
        position: absolute;
        top: 0;
        right: 0;
        width: 20px;
        height: 20px;
        cursor: pointer;
    }

    .upImg {
        width: 80px;
        height: 80px;
    }

    .formfixed {
        position: relative;
    }

    .remove {
        position: absolute;
        top: 125%;
        right: -175px;
        transform: translateY(-50%);
        cursor: pointer;
    }

    .myheader {
        height: 140px;
        background-color: #FFFFFF;
        padding: 20px 0;
        display: flex;
        align-items: center;
        margin: 0;
        flex-wrap: wrap;
    }

    .layui-tab {

        overflow: auto;
        background-color: #FFFFFF;
        margin: 10px 0 0 0;
    }

    .layui-input-block1 {
        display: flex;
        align-items: center;
        justify-content: flex-start
    }
    .layui-tab-title{
        height: 40px!important;
    }
    .layui-tab-content{
        height: calc(100% - 55px);
        overflow: auto;
    }
    .layui-disabled, .layui-disabled:hover {
        color: #000 !important;
        cursor: not-allowed !important;
    }
    #consumerNotice—wrapper{
        width: calc(100% - 145px);
        margin-left: 115px;
        border: 1px solid #ccc;
        z-index: 999; /* 按需定义 */
    }
    .layui-form-select dl,.xm-body{
        z-index: 1000!important;
    }
</style>
<body>
<input id="userId" th:value="${id}" style="display: none">
<input id="infoType" th:value="${type}" style="display: none">
<div class="layui-fluid mt2" style="background-color: #f0f2f5;    padding: 0 !important;">
    <form class="layui-form" style="height: 100%;">

        <div class="layui-form-item" style="background: #fff;  height: 60px;    padding-top: 10px;" th:if="${type=='infor'}">
            <div class="layui-inline" style="width: calc((100% - 55px) / 3)">
                <label class="layui-form-label">发布人：</label>
                <div class="layui-input-block layui-input-block1" th:text="${myData?.userName}">
                </div>
            </div>
            <div class="layui-inline" style="width: calc((100% - 55px) / 3)">
                <label class="layui-form-label">服务人：</label>
                <div class="layui-input-block layui-input-block1" th:text="${myData?.serviceUserName}">
                </div>
            </div>
            <div class="layui-inline" style="width: calc((100% - 55px) / 3)">
                <label class="layui-form-label">发布时间：</label>
                <div class="layui-input-block layui-input-block1" th:text="${myData?.createTime} eq null ? '' : ${#dates.format(myData?.createTime, 'yyyy-MM-dd HH:mm:ss')}">
                </div>
            </div>

        </div>

        <div class="layui-form-item " style="background: #fff;  height: 60px;display: flex; align-items: center; padding-left: 30px;   padding-top: 10px;margin: 0" >
            <h3>基本信息</h3>
        </div>
        <div class="layui-form-item" style="background: #fff;  height: 60px;   padding-top: 10px;margin: 0">
            <div class="layui-inline" style="width: calc((100% - 55px) / 3)">
                <label class="layui-form-label required">标题</label>
                <div class="layui-input-block">
                    <input type="text" name="desireSalary" lay-verify="required" autocomplete="off"
                           name="title"
                           th:disabled="${type=='infor'}"
                           th:value="${myData?.title}"
                           th:placeholder="${type=='infor'?'':'请输入标题'}" class="layui-input">
                </div>
            </div>
            <div class="layui-inline" style="width: calc((100% - 55px) / 3)">
                <label class="layui-form-label required">工作类型</label>
                <div  class="layui-input-block">
                    <input id="projectIdValue" th:value="${myData?.projectId}" style="display: none">
                    <select class="layui-input-block1"
                            id="projectId"
                            name="projectId"
                            lay-verify="required"
                            lay-search=""
                            th:disabled="${type=='infor'}">
                    </select>
                </div>

            </div>
            <div class="layui-inline" style="width: calc((100% - 55px) / 3)">
                <label class="layui-form-label required">性别</label>
                <div class="layui-input-block">
                    <select name="sex" lay-verify="required" th:disabled="${type=='infor'}">
                        <option value="" th:text="${type=='infor'?' ':'请选择'}"></option>
                        <option value="1" th:selected="${myData?.sex == '1'}">男</option>
                        <option value="2" th:selected="${myData?.sex == '2'}">女</option>
                    </select>
                </div>
            </div>

        </div>
        <div class="layui-form-item" style="background: #fff;  height: 60px;   padding-top: 10px;margin: 0">
            <div class="layui-inline" style="width: calc((100% - 55px) / 3)">
                <label class="layui-form-label required">是否住家</label>
                <div class="layui-input-block">
                    <select name="residentHome" lay-verify="required" th:disabled="${type=='infor'}">
                        <option value="" th:text="${type=='infor'?' ':'请选择'}"></option>
                        <option value="0" th:selected="${myData?.residentHome == '0'}">是</option>
                        <option value="1" th:selected="${myData?.residentHome == '1'}">否</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline" style="width: calc((100% - 55px) / 3)">
                <label class="layui-form-label required">薪资待遇</label>
                <div class="layui-input-block">
<!--                  <input type="text" name="salary" lay-verify="required" autocomplete="off"-->
<!--                       th:disabled="${type=='infor'}"-->
<!--                       th:value="${myData?.salary}"-->
<!--                       th:placeholder="${type=='infor'?'':'请输入薪资'}" class="layui-input">-->
                    <select lay-affix="clear" lay-search=""
                            name="salary" id="salary" lay-verify="required"
                            th:disabled="${type=='infor'}"
                            th:attr="myValue=${myData?.salary}">
                        <option value="">请等待数据加载</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline" style="width: calc((100% - 55px) / 3)">
                <label class="layui-form-label required">工作时间</label>
                <div class="layui-input-block1" id="ID-laydate-range">
                        <input name="workDate" th:value="(${myData?.workDate} eq null ?'':${#dates.format(myData?.workDate, 'yyyy-MM-dd HH:mm:ss')})" lay-verify="required"  th:disabled="${type=='infor'}" type="text" autocomplete="off" id="createTime" class="layui-input" placeholder="开始日期">
                        <div style="width: 20px;text-align: center">-</div>
                        <input name="endDate"  th:value="(${myData?.endDate} eq null ?'':${#dates.format(myData?.endDate, 'yyyy-MM-dd HH:mm:ss')})" lay-verify="required" th:disabled="${type=='infor'}" type="text" autocomplete="off" id="endTime" class="layui-input" placeholder="结束日期">
                </div>
            </div>

        </div>
        <div class="layui-form-item" style="background: #fff;  height: 60px;   padding-top: 10px;margin: 0">
            <div class="layui-inline" style="width: calc((100% - 55px) / 3)">
                <label class="layui-form-label required">工作地址</label>
                <div class="layui-input-block">
                    <input type="text" name="address" lay-verify="required" autocomplete="off"
                           th:disabled="${type=='infor'}"
                           th:value="${myData?.address}"
                           th:placeholder="${type=='infor'?'':'请输入工作地址'}" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item" style="background: #fff;  height: 330px;   padding-top: 10px;">
            <label class="layui-form-label">备注</label>
            <textarea style="width: calc(100% - 150px)" name="remark" placeholder="请输入备注" lay-verify="introduction"
                      th:text="${myData?.remark}"
                      id="remark"
                      th:disabled="${type=='infor'}"
                      class="layui-textarea"></textarea>

        </div>
        <div  th:if="${type=='infor'&&myData?.status==2}" class="layui-form-item " style="background: #fff;  height: 60px;display: flex; align-items: center; padding-left: 30px;   padding-top: 10px;margin: 0" >
            <h3>阿姨信息</h3>
        </div>
        <div  th:if="${type=='infor'&&myData?.status==2}"  class="layui-form-item" style="background: #fff;  height: auto;   padding-top: 10px;display: flex; align-items: center;  justify-content: center;">
            <table class="layui-hide" id="exampleTable" lay-filter="exampleTable"></table>
            <script th:inline="javascript">
                setTimeout(()=>{
                    layui.use(['table'], function () {
                        //table
                        var table = layui.table
                        // 创建渲染实例
                        table.render({
                            elem: '#exampleTable'
                            ,id:'exampleTable'
                            ,cellMinWidth: 80
                            , page: { //支持传入 laypage 组件的所有参数（某些参数除外，如：jump/elem） - 详见文档
                                layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
                                , curr: 1 //设定初始在第 5 页
                                , groups: 5 //只显示 1 个连续页码
                                , limit : 5
                                , limits : [5,15,30,50,100,200]
                            }
                            ,defaultToolbar: false
                            ,cols: [[
                                {
                                    field : 'name',
                                    title : '姓名',
                                    align : 'center'
                                },
                                {
                                    field : 'inchPhoto',
                                    title : '照片',
                                    align : 'center',
                                    templet:(d)=>{
                                        return  d.inchPhoto==''||null==d.inchPhoto?'-':` <img width="40" height="40" onclick="photosClick()" src="${d?.inchPhoto}"/>`
                                    }
                                },
                                {
                                    field : 'mobile',
                                    title : '联系电话',
                                    align : 'center'
                                },
                                {
                                    field : 'sex',
                                    title : '性别',
                                    align : 'center',
                                    templet: function (d) {
                                        return `<span>${d.sex== '1' ? '男':'女'}</span>`
                                    }
                                },
                                {
                                    field: 'projectName',
                                    title: '服务类型',
                                    align: 'center',
                                    templet: function (d) {
                                        let str = '';
                                        let projectName = d.projectName;
                                        if ( projectName != null ){
                                            projectName = projectName.split('、');
                                            projectName.map(function (v,k){
                                                if( v != '' ){
                                                    if ( k <= 2) {
                                                        str += v+'、';
                                                    }
                                                }
                                            })
                                            str=str.substring(0,str.length-1)
                                            return `
							<span>${str}</span>
							`;
                                        }else{
                                            return '-';
                                        }
                                    }
                                },
                                {
                                    field : 'age',
                                    title : '年龄',
                                    align : 'center',
                                },
                                {
                                    field : 'education',
                                    title : '学历',
                                    align : 'center'
                                },
                                {
                                    field : 'workExperience',
                                    title : '工作经验',
                                    align : 'center'
                                },
                                {
                                    field : 'experience',
                                    title : '工作经历',
                                    align : 'center',
                                    templet:(d)=>{
                                        let myJson=JSON.parse(d.experience)
                                        let myFW10=''
                                        if(myJson.length>0){
                                            myFW10= myJson[0].describe
                                        }else{
                                            myFW10='-'
                                        }
                                        return `<span>${myFW10}</span>`
                                    }
                                },
                            ]]
                            ,data:[[${myData.userVOList}]]
                            ,done: function (res){
                                form.render()
                                hindLoading()
                            }
                        });
                    })
                },200)


            </script>
        </div>







        <div class="layui-form-item  layui-flow-more">
            <div class="layui-inline">
                <button type="button" class="layui-btn" lay-submit lay-filter="submit" th:text="${infoType=='push'?'推送':'确定'}"></button>
            </div>
        </div>

    </form>
</div>

<div th:include="include::footer"></div>
<script type="text/javascript" src="/js/xmSelect.js"></script>
<script type="text/javascript" src="/js/webJs/jzweb/backstage/info.js"></script>
</body>
</html>